package 我的JDK基础数据结构.HashMap.HashSet;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.Iterator;

@AllArgsConstructor
@Data
public class Test {

    private String name;


    public static void main(String[] args) {
        HashSet<Test> set=new HashSet<>(10,0.75f,false);
        set.add(new Test("1号"));
        set.add(new Test("2号"));
        set.add(new Test("3号"));
        set.add(new Test("4号"));
        for (Object o : set) {
            System.out.println(o);
        }
        Iterator<Test> iterator = set.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }

}